import sys
import os
from sqlalchemy import Column, SmallInteger, DateTime
from datetime import datetime
from db.session import Base


class BaseModel(Base):
    """
    基础模型
    """
    __abstract__ = True

    is_deleted = Column(SmallInteger, default=False, comment="是否删除")
    create_time = Column(DateTime, default=datetime.now(), comment="创建时间")
    update_time = Column(DateTime, onupdate=datetime.now(), default=datetime.now(), comment="更新时间")